package com.mogu_soup.map;

import com.mogu_soup.entity.Entity;
import com.mogu_soup.entity.Tank;
import com.mogu_soup.util.Constant;
import com.mogu_soup.util.MyUtil;

import java.awt.*;

/**
 * Version: 2.1
 * Author: TangJun
 * Date: 2024-08-03
 * Note:
 */
public class Home extends Brick {
    //继承砖块类，利用多态调用碰撞

    private static final Image[] HOME = new Image[]{
            MyUtil.createImage("resource\\other\\home.png"),
            MyUtil.createImage("resource\\other\\home2.png")
    };
    //默认基地属性
    public static final int HOME_HP = 3;
    public static final int HOME_SIZE = Tank.DEFAULT_SIZE;
    public static final int HOME_X = Constant.FRAME_HEIGHT / 2;
    public static final int HOME_Y = Constant.FRAME_HEIGHT - HOME_SIZE / 2;

    private boolean isEnemy;

    public Home() {
        super(HOME_X, HOME_Y, 0);
        size = HOME_SIZE;
        isLive = true;
        hp = HOME_HP;
        isEnemy = false;
    }
    @Override
    public void draw(Graphics g) {
        if (!isEnemy) {
            g.drawImage(HOME[0], x - size / 2, y - size / 2, size, size,  null);
        }
    }
}
